BEGIN {
	FS = "[\t :\n\r]";
} 

/Start/ {
	startTime=$4; 
#	print "INSERT INTO events (logTime, action, expNum, source) VALUES ('"startTime"', 'start', '"expNum", 'testbed');";
} 

/.sh/ {
#	print $4, $4-startTime, substr($2,6), substr($3,6), substr($1,5,length($1)-7), expNum;
	print "INSERT INTO events (logTime, relTime, nodeA, nodeB, action, expNum, source) VALUES ("$4", "$4-startTime", "substr($2,6)", "substr($3,6)", '"substr($1,5,length($1)-7)"', "expNum", 'testbed');";
	print "INSERT INTO events (logTime, relTime, nodeA, nodeB, action, expNum, source) VALUES ("$4", "$4-startTime", "substr($3,6)", "substr($2,6)", '"substr($1,5,length($1)-7)"', "expNum", 'testbed');";
}